package com.learn.thread;

/**
 * 实现线程方式一：继承Thread
 * 1. extends Thread
 * 2. 重写run方法
 */
public class TestThread1 extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 50; i++) {
            System.out.println("子线程-------->" + i);
        }
    }

    public static void main(String[] args) {
        TestThread1 testThread1 = new TestThread1();
        testThread1.start();
        for (int i = 0; i < 100; i++) {
            System.out.println("主线程---->" + i);
        }

    }
}
